﻿using System;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Dropbox.Api
{
    [JsonObject(MemberSerialization.OptIn)]
    public class Files
    {

        public string state = "closed";
        public string data;
        public FileAttribute attr;
        public List<Files> children;

        public Uri nodeUri { get; set; }


        [JsonProperty(PropertyName = "size")]
        public string Size { get; set; }

        [JsonProperty(PropertyName = "rev")]
        public string Revision { get; set; }

        [JsonProperty(PropertyName = "thumb_exists")]
        public bool ThumbnailExists { get; set; }

        [JsonProperty(PropertyName = "bytes")]
        public long Bytes { get; set; }

        [JsonProperty(PropertyName = "is_dir")]
        public bool IsDirectory { get; set; }

        [JsonProperty(PropertyName = "root")]
        public string Root { get; set; }

        [JsonProperty(PropertyName = "icon")]
        public string Icon { get; set; }

        [JsonProperty(PropertyName = "mime_type")]
        public string MimeType { get; set; }

        [JsonProperty(PropertyName = "path")]
        public string Path { get; set; }

        [JsonProperty(PropertyName = "contents")]
        public IEnumerable<Files> Contents { get; set; }

        [JsonProperty(PropertyName = "modified")]
        public DateTime Modified { get; set; }

    }

    public class FileAttribute
    {
        public string id;
        public Uri root;
        public string path;
    }
}
